package com.ApiBack.springbootinit.service.impl.inner;

import com.ApiBack.springbootinit.common.ErrorCode;
import com.ApiBack.springbootinit.exception.BusinessException;
import com.ApiBack.springbootinit.mapper.InterfaceInfoMapper;
import com.ApiBack.springbootinit.model.entity.InterfaceInfo;
import com.ApiBack.springbootinit.model.entity.User;
import com.ApiBack.springbootinit.service.InnerInterfaceInfoService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;


import org.apache.commons.lang3.StringUtils;
import org.apache.dubbo.config.annotation.DubboService;

import javax.annotation.Resource;

/**
 * Description:    // 类说明
 *
 * @ClassName: InnerInterfaceInfoServiceImpl    // 类名，会自动填充
 * @Author: 周天赐        // 创建者
 * @Email: m18879004515@163.com
 * @Date: 2024/3/6 10:35   // 时间
 * @Version: 1.0     // 版本
 */
@DubboService
public class InnerInterfaceInfoServiceImpl implements InnerInterfaceInfoService {

    @Resource
    private InterfaceInfoMapper interfaceInfoMapper;


    @Override
    public InterfaceInfo getInterfaceInfo(String url, String method) {
        if (StringUtils.isAnyBlank(url,method))
        {
            throw new BusinessException(ErrorCode.PARAMS_ERROR);
    }

        QueryWrapper<InterfaceInfo> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("url", url);
        queryWrapper.eq("method", method);
        InterfaceInfo interfaceInfo = interfaceInfoMapper.selectOne(queryWrapper);
        return interfaceInfo;


    }
}

    
    
